/**
 * 
 */
package match;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author ZhuJiahui506
 *
 */
public class GenerateString {
	
	final char[] alphabet = {
			'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 
			'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 
			'u', 'v', 'w', 'x', 'y', 'z'
	};
	
	public ArrayList<String> generatePatterns(int patternNum, int maxLength, int minLength) {
		
		ArrayList<String> patternStrings = new ArrayList<String>();	
		Random random = new Random();
		
		for (int i = 0; i < patternNum; ++i) {
			int thisLength = random.nextInt(maxLength - minLength + 1) + minLength;
			
			StringBuilder thisPattern = new StringBuilder();
			for (int j = 0; j < thisLength; ++j) {
				char thisChar = alphabet[random.nextInt(26)];
				thisPattern.append(thisChar);
			}
			patternStrings.add(thisPattern.toString());
		}
		
		return patternStrings;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GenerateString gs = new GenerateString();
		ArrayList<String> patternStrings = gs.generatePatterns(100, 6, 2);
		ArrayList<String> matchStrings = gs.generatePatterns(1000, 100, 50);

	}

}
